package com.company.model;

/**
 * 删除类型
 * Created by tu on 2017/7/7.
 */
public enum DeleteType {
  /**
   * 删除
   */
  DELETED(1),
  /**
   * 未删除
   */
  NON(0);
  public final int code;

  DeleteType(int code) {
    this.code = code;
  }

  public static DeleteType fromCode(int code) {
    for (DeleteType deleteType : values()) {
      if (deleteType.code == code) {
        return deleteType;
      }
    }
    return NON;
  }
}
